package shop.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import shop.dao.IProductDao;
import shop.model.Product;

@Service
public class ProductServiceImpl implements IProductService {

	@Resource
	private IProductDao dao;
	
	@Override
	public int isPutOnSaleYes(int id) {
		int stock = dao.getStock(id);
		if(stock>0) {
			return dao.isPutOnSaleYes(id);
		}else {
			return 0;//失败
		}
	}

	@Override
	public List<Product> findToday() {
		return dao.findToday();
	}

}
